//$URL: http://dasding.googlecode.com/svn/branches/testzeugs/data/data/src/main/java/de/piratech/dasding/data/Action.java $
//$Id: Action.java 107 2013-03-29 14:27:07Z krieg.maria@gmail.com $
/*
 * Copyright 2012 Piratech.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package de.piratech.dasding.data;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import org.codehaus.jackson.annotate.JsonIgnore;

/**
 * An Action
 * 
 * @author deveth0
 */
@XmlRootElement
public class Action extends AbstractAction {

  /**
   * The different action status
   */
  public enum ACTIONSTATUS {

    /**
     * Action still requires participants
     */
    REQUIRES_PARTICIPANTS,
    /**
     * Aciton will happen
     */
    WILL_HAPPEN,
    /**
     * Action has been canceled
     */
    CANCELED
  }

  private ACTIONSTATUS mStatus = ACTIONSTATUS.REQUIRES_PARTICIPANTS;
  private List<String> mParticipants = new ArrayList<String>();
  private String mCategory;
  private String eventId;

  public ACTIONSTATUS getStatus() {
    return mStatus;
  }

  public void setStatus(ACTIONSTATUS pStatus) {
    this.mStatus = pStatus;
  }

  @XmlElementWrapper
  public List<String> getParticipants() {
    return mParticipants;
  }

  public void setParticipants(List<String> pParticipants) {
    this.mParticipants = pParticipants;
  }

  public String getCategory() {
    return mCategory;
  }

  public void setCategory(String pCategory) {
    this.mCategory = pCategory;
  }
  
  public String getEventId() {
    return this.eventId;
  }
  
  public void setEventId(String id) {
    this.eventId = id;
  }

  @Override
  @JsonIgnore
  public boolean isValid() {
    return super.isValid() && mCategory != null;
  }


}
